package com.maodou.core.network


/**
 * 通用后端响应 Envelope：适配以下两类结构：
 * 1) 常规数据：{"code":"SUCCESS","success":true,"message":"...","data":{...}}
 * 2) 分页数据：{"code":"SUCCESS","success":true,"message":"...","data":{"records":[],"total":..., ...}}
 */
 data class ApiEnvelope<T>(
     val code: String? = null,
     val success: Boolean? = null,
     val message: String? = null,
     val data: T? = null
 )

/**
 * 分页数据结构，嵌套在 ApiEnvelope 的 data 中。
 */
 data class PageEnvelope<T>(
     val records: List<T> = emptyList(),
     val total: Int = 0,
     val size: Int = 0,
     val current: Int = 0,
     val orders: List<Any>? = null,
     val optimizeCountSql: Boolean? = null,
     val searchCount: Boolean? = null,
     val pages: Int? = null
 )